package com.zjxf.service;

import com.alibaba.fastjson.JSONObject;
import com.zjxf.base.bean.po.CmsNews;
import com.zjxf.base.bean.po.UmsStoreSeller;
import com.zjxf.base.bean.ro.RoCmsNews;
import com.zjxf.base.bean.vo.VoCmsNews;
import com.zjxf.base.common.OperationException;
import org.springframework.data.domain.Page;

/**
 * 新闻
 *
 * @author ZhangWei
 * @date 2021/4/6/006 10:51
 */
public interface CmsNewsService {

    /**
     * 添加新闻
     *
     * @param vo
     * @param umsStoreSeller
     */
    void addOrUpdate(VoCmsNews.addOrUpdate vo, UmsStoreSeller umsStoreSeller) throws OperationException;

    /**
     * 删除新闻
     *
     * @param id
     */
    void delete(Long id) throws OperationException;

    /**
     * 回显
     *
     * @param id
     * @return
     */
    CmsNews getEntity(Long id) throws OperationException;

    /**
     * ro回显
     *
     * @param cmsNews
     * @return
     */
    RoCmsNews.Details getEntityRo(CmsNews cmsNews);

    /**
     * 分页
     *
     * @param filter
     * @param umsStoreSeller
     * @return
     */
    Page<CmsNews> page(VoCmsNews.filter filter,UmsStoreSeller umsStoreSeller);
    /**
     * 分页
     *
     * @param filter
     * @return
     */
    Page<CmsNews> appPage(VoCmsNews.appFilter filter);

    /**
     * ro分页
     * @param cmsNewsPage
     * @return
     */
    JSONObject pageRo(Page<CmsNews> cmsNewsPage);

    /**
     * 切换显示状态
     * @param vo
     */
    void switchShow(VoCmsNews.SwitchShow vo) throws OperationException;
}
